#include <iostream>
using namespace std;

void feltriangle(ostream& outs, unsigned int m, unsigned int n)
{
	if (m <= n)
	{
		for (int i = m; i <= n; ++i)
		{
			for (int j = 0; j < i; ++j)
			{
				cout << "*";
			}
			cout << endl;
		}
		for (int i = n; i >= m; --i)
		{
			for (int j = 0; j < i; ++j)
			{
				cout << "*";
			}
			cout << endl;
		}
	}
	else
		cout << "!";

}

void triangle(ostream& outs, unsigned int m, unsigned int n)
{
	
	if (m <= n)
	{
		if (m == n)
		{
			for (int j = 0; j < 2; ++j)
			{
				for (int i = 0; i < m; ++i)
				{

					outs << "*";
				}
				outs << endl;
			}
		}
		else
		{
			for (int i = 0; i < m; ++i)
			{
				outs << "*";
			}
			outs << endl;
			triangle(outs, m + 1, n);

			for (int i = 0; i < m; ++i)
			{
				outs << "*";
			}
			outs << endl;
		}

	}
	else
		outs << "!";

}






int main()
{
	//feltriangle(cout, 1, 40);
	triangle(cout, 1, 10);
	cin.get();
	return 0;
}